{include file="/shopro/common/script" /}

<div id="index" class="reward-index panel panel-default panel-intro" v-cloak>
    <el-container class="panel-block">
        <el-header class="sa-header">
            <div class="sa-title sa-flex sa-row-between">
                <div class="sa-title-left">
                    <div class="left-name">每日业绩明细</div>
                    <div style="padding-left: 20px;color: red">总零售额：￥<span class="retail">{{state.retail}}</span>
                        总支付额：￥<span class="payment">{{state.payment}}</span>
                        总留存：￥<span class="retained">{{state.retained}}</span></div>
                    <sa-filter-condition v-model="state.filter" @filter-delete="onChangeFilter">
                    </sa-filter-condition>
                </div>
                <div class="sa-title-right">
                    <el-button class="sa-button-refresh" icon="RefreshRight" @click="getData"></el-button>
                    <el-button class="sa-button-refresh" icon="Search" @click="onOpenFilter"></el-button>
                    {if $auth->check('shopro/commission/daily/export')}
                    <el-button :loading="exportLoading" :disabled="exportLoading" @click="onExport('export')">导出
                    </el-button>
                    {/if}
                </div>
            </div>
        </el-header>
        <el-main class="sa-main">
            <el-table height="100%" class="sa-table" :data="state.data" stripe>
                <el-table-column prop="id" label="ID" min-width="90"></el-table-column>
                <el-table-column prop="retail" label="总零售额" min-width="80"></el-table-column>
                <el-table-column prop="payment" label="总支付额" min-width="80">
                    <template #default="scope">
                        {{scope.row.payment}}
                        <p>货款：{{scope.row.paygoods_price}}</p>
                        <p>运费：{{scope.row.freight}}</p>
                        <p>优惠金额：{{scope.row.total_discount_fee}}</p>
                    </template>
                </el-table-column>
                <el-table-column prop="pv_price" label="总pv" min-width="80"></el-table-column>
                <el-table-column prop="retained" label="总留存" min-width="80"></el-table-column>
                <el-table-column prop="pc_paygoods" label="向平台进货货款" min-width="80"></el-table-column>
                <el-table-column prop="pc_equal" label="平台发放进货推荐奖" min-width="80"></el-table-column>
                <el-table-column prop="pc_bonus" label="3%分红" min-width="80"></el-table-column>
                <el-table-column prop="pc_individual" label="个体户5%" min-width="80"></el-table-column>
                <el-table-column prop="createtime" label="创建时间" min-width="80"></el-table-column>
            </el-table>
        </el-main>
        <el-footer class="sa-footer sa-flex sa-row-right">
            <sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
        </el-footer>
    </el-container>
    <sa-filter v-model="state.filter" @filter-change="onChangeFilter"></sa-filter>
</div>